<form action="/wizard/useredit" method="post" id="editForm">
<input type="hidden" id="act" name="act" value="edit"/>
<input type="hidden" id="userid" name="userid" value="<?php echo $this->userInfo["userId"]; ?>"/>
<h3>Update User Info:</h3><br>
    <?php echo $this->render('layouts/__info.phtml'); ?>
    <table class="normaltable" style="margin-left:10px">
    <tr><td>Name</td><td><input type="text" id="name" name="name" value="<?php echo $this->userInfo["userName"]; ?>"></td></tr>
     <tr><td>Password</td><td><input type="password" id="passwd" name="passwd" value="<?php echo $this->userInfo["passwd"]; ?>"></td></tr>
    <tr><td>Phone</td><td><input type="text" id="phone" name="phone" value="<?php echo $this->userInfo["phone"]; ?>"></td></tr>
    <tr><td>Mail</td><td><input type="text" id="email" name="email" value="<?php echo $this->userInfo["email"]; ?>"></td></tr>
    <tr><td>Team</td><td>
    <select id="team" name="team">
	<?php foreach($this->teamList as $team):?>		
    <option value="<?php echo $team->id;?>" <?php if($team->id ==$this->userInfo["teamId"]):?>selected<?php endif;?>><?php echo $team->name;?></option>                         
	<?php endforeach;?>    
	</select></td></tr>
	<tr><td>Role</td><td>
    <select id="role" name="role">
	<?php foreach($this->roleList as $role):?>
    <option value="<?php echo $role->id;?>" <?php if($role->id ==$this->userInfo["roleId"]):?>selected<?php endif;?>><?php echo $role->name;?></option>                     
	<?php endforeach;?>    
	</select>
	</td></tr>
    <tr><td colspan="2" style="text-align:center"><input type="button" value="change" onclick="updateUserInfo()" id="edituser" name="edituser" /></td></tr>
    </table>
</form>

<script type="text/javascript">
function updateUserInfo(){
	var formParams = $('editForm').toQueryString();	
	var request_uri = '/wizard/useredit?ajax=1&t='+(new Date()).getTime();	
	PopBox.pop('loading ...', {loading:true});
	new Ajax(request_uri, {
			method: 'post',
			evalScripts : true,
			data: formParams,
			onComplete: function(){	
				PopBox.pop(this.response.text);
			}
	}).request();
}
</script>